<?php

class Autoload{

    protected static $map = [
        'lib'   => ROOT_PATH . 'lib/'
    ];

    static function register(){
        spl_autoload_register(function($class){
            $type = explode('\\', $class);
            $filename = self::$map[$type[0]] . DS . ucfirst($type[1]) . '.php';
            if(file_exists($filename)){
                require_once $filename;
            }
        });
    }

}